package org.dark.fund.web;


import org.dark.fund.api.IFundService;
import org.dark.fund.common.ApiResult;
import org.dark.fund.dao.entity.Archives;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wanlh
 * @since 2021-04-29
 */
@RestController
@RequestMapping("/fund/history")
public class HistoricalNetValueController {

    /**
     * 基金服务
     */
    @Autowired
    IFundService fundService;

    /**
     * 基金档案
     * @param fundCode
     * @return
     */
    @GetMapping("/{fundCode}")
    public ApiResult<Archives> getArchives(@PathVariable String fundCode){
        return ApiResult.ok(fundService.getArchives(fundCode));
    }
}
